
/*
* Copyright 2017-2018 pinganfang
* All right reserved.
*
*/
package com.pingan.haofang.searchcloud.indexdatasource.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.pingan.haofang.searchcloud.common.domain.BaseDomain;
import com.pingan.haofang.searchcloud.common.domain.IdGetter;

/**
 * 数据库数据源
 *
 * @author huhailiang937
 */
@Entity
@Table(name = "t_index_datasource_sql")
@EntityListeners({AuditingEntityListener.class})
public class IndexDatasourceSql extends BaseDomain implements IdGetter<Long> {

    /**
     * ID
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private Long id;

    /**
     * DB类型 0：mysql 1:sqlsever 2:orcle
     */
    @Column(name = "db_type")
    private Integer dbType;

    /**
     * DB链接URL
     */
    @Column(name = "jdbc_url")
    private String jdbcUrl;

    /**
     * DB端口
     */
    @Column(name = "db_port")
    private Integer dbPort;

    /**
     * DB用户
     */
    @Column(name = "db_user")
    private String dbUser;

    /**
     * DB密码
     */
    @Column(name = "db_pwd")
    private String dbPwd;

    /**
     * 导入SQL
     */
    @Column(name = "import_sql")
    private String importSql;

    /**
     * 批次查询分页大小
     */
    @Column(name = "import_pagesize")
    private Integer importPagesize;

    /**
     * cron表达式
     */
    @Column(name = "import_cron")
    private String importCron;

    /**
     * 索引简介
     */
    @Column(name = "introduction")
    private String introduction;


    /**
     * 状态 0：正常 1：停用
     */
    @Column(name = "status")
    protected Integer status;

    /**
     * ID
     *
     * @param id the value for id
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * ID
     *
     * @return id the value for id
     */
    public Long getId() {
        return this.id;
    }

    /**
     * DB类型 0：mysql 1:sqlsever 2:orcle
     *
     * @param dbType the value for db_type
     */
    public void setDbType(Integer dbType) {
        this.dbType = dbType;
    }

    /**
     * DB类型 0：mysql 1:sqlsever 2:orcle
     *
     * @return dbType the value for db_type
     */
    public Integer getDbType() {
        return this.dbType;
    }

    /**
     * DB链接URL
     *
     * @param jdbcUrl the value for jdbc_url
     */
    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    /**
     * DB链接URL
     *
     * @return jdbcUrl the value for jdbc_url
     */
    public String getJdbcUrl() {
        return this.jdbcUrl;
    }

    /**
     * DB端口
     *
     * @param dbPort the value for db_port
     */
    public void setDbPort(Integer dbPort) {
        this.dbPort = dbPort;
    }

    /**
     * DB端口
     *
     * @return dbPort the value for db_port
     */
    public Integer getDbPort() {
        return this.dbPort;
    }

    /**
     * DB用户
     *
     * @param dbUser the value for db_user
     */
    public void setDbUser(String dbUser) {
        this.dbUser = dbUser;
    }

    /**
     * DB用户
     *
     * @return dbUser the value for db_user
     */
    public String getDbUser() {
        return this.dbUser;
    }

    /**
     * DB密码
     *
     * @param dbPwd the value for db_pwd
     */
    public void setDbPwd(String dbPwd) {
        this.dbPwd = dbPwd;
    }

    /**
     * DB密码
     *
     * @return dbPwd the value for db_pwd
     */
    public String getDbPwd() {
        return this.dbPwd;
    }

    /**
     * 导入SQL
     *
     * @param importSql the value for import_sql
     */
    public void setImportSql(String importSql) {
        this.importSql = importSql;
    }

    /**
     * 导入SQL
     *
     * @return importSql the value for import_sql
     */
    public String getImportSql() {
        return this.importSql;
    }

    /**
     * 批次查询分页大小
     *
     * @param importPagesize the value for import_pagesize
     */
    public void setImportPagesize(Integer importPagesize) {
        this.importPagesize = importPagesize;
    }

    /**
     * 批次查询分页大小
     *
     * @return importPagesize the value for import_pagesize
     */
    public Integer getImportPagesize() {
        return this.importPagesize;
    }

    /**
     * cron表达式
     *
     * @param importCron the value for import_cron
     */
    public void setImportCron(String importCron) {
        this.importCron = importCron;
    }

    /**
     * cron表达式
     *
     * @return importCron the value for import_cron
     */
    public String getImportCron() {
        return this.importCron;
    }

    /**
     * 索引简介
     *
     * @param introduction the value for introduction
     */
    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    /**
     * 索引简介
     *
     * @return introduction the value for introduction
     */
    public String getIntroduction() {
        return this.introduction;
    }

    /**
     * @return the status
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * @param status the status to set
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
    public String toString() {
        return "IndexDatasourceSql{" +
                "id=" + id +
                ", dbType=" + dbType +
                ", jdbcUrl='" + jdbcUrl + '\'' +
                ", dbPort=" + dbPort +
                ", dbUser='" + dbUser + '\'' +
                ", dbPwd='" + dbPwd + '\'' +
                ", importSql='" + importSql + '\'' +
                ", importPagesize=" + importPagesize +
                ", importCron='" + importCron + '\'' +
                ", introduction='" + introduction + '\'' +
                ", status=" + status +
                "} " + super.toString();
    }
}
